<?php

namespace app\config;

class Error{
	const OK = 0;
	const INTERNAL = 1;
	const UNKNOW = 2;
	const DATA = 10001;

	protected static $msg = [
		OK => 'ok',
		INTERNAL => 'internal',
		UNKNOW => 'unknow',
		DATA => 'DATA',
	];

	public static function msg($idx){
		$name = isset(self::$msg[$idx]) ? self::$msg[$idx] : self::$msg[self::UNKNOW];
		return Yii::t('api', $name);
	}
}